/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package recanto.das.pedrinhas;

import java.util.List;
import java.util.Vector;
import recanto.das.pedrinhas.bean.Cliente;
import recanto.das.pedrinhas.controller.ClienteController;
import recanto.das.pedrinhas.dao.ClienteDao;

/**
 *
 * @author daphinefiuza
 */
public class FrameJanelaMenus extends javax.swing.JFrame {

    /**
     * Creates new form FrameJanelaMenus
     */
    public FrameJanelaMenus() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        labelCompJunior = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMaximizedBounds(new java.awt.Rectangle(0, 0, 1030, 700));
        setMaximumSize(new java.awt.Dimension(1030, 670));
        setMinimumSize(new java.awt.Dimension(1030, 670));
        getContentPane().setLayout(null);

        jButton1.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagem/pesquisar.png"))); // NOI18N
        jButton1.setText("Pesquisar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton1);
        jButton1.setBounds(716, 284, 320, 90);

        jButton2.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagem/reservar.png"))); // NOI18N
        jButton2.setText("Reservar");
        jButton2.setActionCommand("ReservaEtapa1");
        jButton2.addActionListener(new ControleReserva());
        getContentPane().add(jButton2);
        jButton2.setBounds(386, 385, 320, 90);

        jButton3.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagem/obs.png"))); // NOI18N
        jButton3.setText("Registrar Observação");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton3);
        jButton3.setBounds(56, 385, 320, 90);

        jButton4.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagem/aniversario.png"))); // NOI18N
        jButton4.setText("Aniversariantes");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton4);
        jButton4.setBounds(716, 385, 320, 90);

        jButton5.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagem/Titular.png"))); // NOI18N
        jButton5.setText("Cadastrar Titular");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton5);
        jButton5.setBounds(56, 284, 320, 90);

        jButton6.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
        jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagem/Acompanhante.png"))); // NOI18N
        jButton6.setText("Cadastrar Acompanhante ");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton6);
        jButton6.setBounds(386, 284, 320, 90);

        labelCompJunior.setFont(new java.awt.Font("Century Gothic", 0, 14)); // NOI18N
        labelCompJunior.setText("© 2012 CompJunior - Todos os direitos reservados");
        getContentPane().add(labelCompJunior);
        labelCompJunior.setBounds(380, 590, 440, 54);

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagem/fundo.jpg"))); // NOI18N
        getContentPane().add(jLabel2);
        jLabel2.setBounds(0, 0, 1080, 660);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-1096)/2, (screenSize.height-693)/2, 1096, 693);
    }// </editor-fold>//GEN-END:initComponents

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
        FrameCadastrarObservacao frameCadastrarObservacao = new FrameCadastrarObservacao();
        frameCadastrarObservacao.setVisible(true);
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        FramePesquisa framePesquisa = new FramePesquisa();
        framePesquisa.setVisible(true);
        
    }//GEN-LAST:event_jButton1ActionPerformed

        private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        // TODO add your handling code here:
        FrameAniversariantes frameAniversariantes = new FrameAniversariantes();
        frameAniversariantes.setVisible(true);
                
        ClienteDao clienteDao = new ClienteDao();
        List<Cliente> clientes = clienteDao.carregaClientes();
        ClienteController clienteController = new ClienteController();
        for(int i=0; i<clientes.size(); ++i){
           if (clienteController.isAniversariante(clientes.get(i))){
               frameAniversariantes.adiciona(clientes.get(i));
           }
        }
    }

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        // TODO add your handling code here:
        FrameFichaCadastroTitular frameTitular = new FrameFichaCadastroTitular();
        frameTitular.setVisible(true);
        frameTitular.setFuncao("cadastrar");
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        // TODO add your handling code here:
        FrameFichaCadastroAcompanhante frameAcompanhante = new FrameFichaCadastroAcompanhante();
        frameAcompanhante.setVisible(true);
    }//GEN-LAST:event_jButton6ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FrameJanelaMenus.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FrameJanelaMenus.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FrameJanelaMenus.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FrameJanelaMenus.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new FrameJanelaMenus().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel labelCompJunior;
    // End of variables declaration//GEN-END:variables
}
